# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test01
# Description:  例10.1
# Author:       ASUS
# Date:         2019/3/12
#-------------------------------------------------------------------------------


class Person:
    # Person类的构造方法
    def __init__(self,name = "Bill"):
        print("构造方法已经被调用")
        self.name = name
    def getName(self):
        return self.name
    def setName(self,name):
        self.name = name

person = Person()                         #创建实例时，Person类的构造方法会被调用
print(person.getName())
person1 = Person(name = "Mike")
print(person1.getName())
person1.setName(name = "John")
print(person1.getName())


